import request from '@/config/axios'

// ERP 技师 VO
export interface EngineerVO {
  id: number // 客户编号
  name: string // 客户名称
  contact: string // 联系人
  mobile: string // 手机号码
  telephone: string // 联系电话
  email: string // 电子邮箱
  fax: string // 传真
  remark: string // 备注
  status: number // 开启状态
  sort: number // 排序
  taxNo: string // 纳税人识别号
  taxPercent: number // 税率
  bankName: string // 开户行
  bankAccount: string // 开户账号
  bankAddress: string // 开户地址
}

// ERP 技师 API
export const EngineerApi = {
  // 查询ERP 技师分页
  getEngineerPage: async (params: any) => {
    return await request.get({ url: `/erp/engineer/page`, params })
  },

  simpleList: async () => {
    return await request.get({ url: `/erp/engineer/simpleList`})
  },

  getRoyaltyDetail: async (params: any) => {
    return await request.get({ url: `/erp/engineer/getRoyaltyDetail`, params })
  },

  // 查询ERP 技师详情
  getEngineer: async (id: number) => {
    return await request.get({ url: `/erp/engineer/get?id=` + id })
  },

  // 新增ERP 技师
  createEngineer: async (data: EngineerVO) => {
    return await request.post({ url: `/erp/engineer/create`, data })
  },

  // 修改ERP 技师
  updateEngineer: async (data: EngineerVO) => {
    return await request.put({ url: `/erp/engineer/update`, data })
  },

  // 删除ERP 技师
  deleteEngineer: async (id: number) => {
    return await request.delete({ url: `/erp/engineer/delete?id=` + id })
  },

  // 导出ERP 技师 Excel
  exportEngineer: async (params) => {
    return await request.download({ url: `/erp/engineer/export-excel`, params })
  },
}
